<html>
<?php
abstract class Form
{
	abstract protected function Render();
}

class TimeSheet extends Form
{
	public function Render() {
?>
<center>
<table border = "1" width="1000">
	
	<tr valign="top"><td>
		<form action="controller/php/submit_form.php" method="post">
			<center>
			<p><font size="8" >Shelly Ward Enterprises Daily Time Sheet</font></p>

			Date: <input type="date" name="Date" />
			Employee ID: <input type="text" name="EmployeeID" value="<?php echo $_SESSION["employee_id"] ?>" disabled="poop" />
			Employee Name:
			<?php
					
					//get the employee id from the session cookie
					$employeeId = $_SESSION["employee_id"];
					
					//make connection to database, bail if no connection
					$connection = odbc_pconnect('utrocks','','');
					if (!$connection) { exit("Connection Failed: " . $connection); }
					
					//retrieve usernames and passwords
					$sql = "SELECT (EName) as EID FROM LoginTable WHERE EmployeeID='$employeeId'";
					
					$rs = odbc_exec($connection, $sql);
				
					while(odbc_fetch_row($rs)) {
						$rowJobNum = odbc_result($rs, 'EID');
						printf("<input type ='text' disabled='true' value='%s'/>", $rowJobNum, $rowJobNum);
					}
				
				?>
			</center>
	</td></tr>
		
	<tr valign="top"><td>
			<center>
			<br /><b><Font size="5">Job Type:</Font></b><br /><br />
			Fab:<input type="checkbox" value="Fab" id="fab" name="JobType" disable="true" onclick="showHide('#make','#fab'), showHide('#model','#fab'), showHide('#vin','#fab'), showHide('#color','#fab'), showHide('#cctype','#fab'), showHide('#ccnum','#fab'), showHide('#totcost','#fab'), showHide('#year','#fab'),disable('#prep','#fab'), disable('#shoot','#fab'), disable('#pickup','#fab'), disable('#return','#fab'), disable('#transport','#fab'), disable('#wrap','#fab'), disable('#travel','#fab'), disable('#rnm','#fab'), disable('#genlshop','#fab'), disable('#fuel','#fab'), disable('#otherp','#fab')">&nbsp;
			Prep:<input type="checkbox" value="Prep" id="prep" name="JobType" disable="true" onclick="showHide('#make','#prep'), showHide('#model','#prep'), showHide('#vin','#prep'), showHide('#color','#prep'), showHide('#year','#prep'), disable('#fab','#prep'), disable('#shoot','#prep'), disable('#wrap','#prep'), disable('#pickup','#prep'), disable('#return','#prep'), disable('#transport','#prep'), disable('#travel','#prep'), disable('#rnm','#prep'), disable('#genlshop','#prep'), disable('#fuel','#prep'), disable('#otherp','#prep')">&nbsp;
			Shoot:<input type="checkbox" value="Shoot" id="shoot" name="JobType" disable="true" onclick="showHide('#begmile','#shoot'),showHide('#endmile','#shoot'),showHide('#tandt','#shoot'),showHide('#citys','#shoot'),showHide('#citye','#shoot'),showHide('#states','#shoot'),showHide('#statee','#shoot'),showHide('#make','#shoot'), showHide('#model','#shoot'), showHide('#vin','#shoot'), showHide('#color','#shoot'), showHide('#year','#shoot'), disable('#fab','#shoot'), disable('#prep','#shoot'), disable('#wrap','#shoot'), disable('#pickup','#shoot'), disable('#return','#shoot'), disable('#transport','#shoot'), disable('#travel','#shoot'), disable('#rnm','#shoot'), disable('#genlshop','#shoot'), disable('#otherp','#shoot')">&nbsp;
			Wrap:<input type="checkbox" value="Wrap" id="wrap" name="JobType" disable="true" onclick="showHide('#make','#wrap'), showHide('#model','#wrap'), showHide('#vin','#wrap'), showHide('#color','#wrap'), showHide('#year','#wrap'),disable('#fab','#wrap'), disable('#prep','#wrap'), disable('#shoot','#wrap'), disable('#pickup','#wrap'), disable('#return','#wrap'), disable('#transport','#wrap'), disable('#travel','#wrap'), disable('#rnm','#wrap'), disable('#genlshop','#wrap'), disable('#fuel','#wrap'), disable('#otherp','#wrap')">&nbsp;	
			Pickup:<input type="checkbox" value="Pickup" id="pickup" name="JobType" disable="true" onclick="showHide('#begmile','#pickup'),showHide('#make','#pickup'), showHide('#model','#pickup'), showHide('#vin','#pickup'), showHide('#color','#pickup'), showHide('#year','#pickup'),showHide('#endmile','#pickup'), showHide('#tandt','#pickup'),showHide('#citys','#pickup'),showHide('#citye','#pickup'),showHide('#states','#pickup'),showHide('#statee','#pickup'),disable('#fab','#pickup'),disable('#prep','#pickup'), disable('#shoot','#pickup'), disable('#wrap','#pickup'), disable('#return','#pickup'), disable('#transport','#pickup'), disable('#travel','#pickup'), disable('#rnm','#pickup'), disable('#genlshop','#pickup'), disable('#otherp','#pickup')">&nbsp;
			Return:<input type="checkbox" value="Return" id="return" name="JobType" disable="true" onclick="showHide('#begmile','#return'),showHide('#make','#return'), showHide('#model','#return'), showHide('#vin','#return'), showHide('#color','#return'), showHide('#year','#return'), showHide('#endmile','#return'), showHide('#tandt','#return'),showHide('#citys','#return'),showHide('#citye','#return'),showHide('#states','#return'),showHide('#statee','#return'),disable('#fab','#return'),disable('#prep','#return'), disable('#shoot','#return'), disable('#pickup','#return'), disable('#wrap','#return'), disable('#transport','#return'), disable('#travel','#return'), disable('#rnm','#return'), disable('#genlshop','#return'), disable('#otherp','#return')">&nbsp;	
			Transport:<input type="checkbox" value="Transport" id="transport" name="JobType" disable="true" onclick="showHide('#begmile','#transport'),showHide('#make','#transport'), showHide('#model','#transport'), showHide('#vin','#transport'), showHide('#color','#transport'), showHide('#year','#transport'), showHide('#endmile','#transport'),showHide('#tandt','#transport'),showHide('#citys','#transport'),showHide('#citye','#transport'),showHide('#states','#transport'),showHide('#statee','#transport'),disable('#fab','#transport'),disable('#prep','#transport'), disable('#shoot','#transport'), disable('#pickup','#transport'), disable('#return','#transport'), disable('#wrap','#transport'), disable('#travel','#transport'), disable('#rnm','#transport'), disable('#genlshop','#transport'), disable('#otherp','#transport')">&nbsp;	
			Travel:<input type="checkbox" value="Travel" id="travel" name="JobType" disable="true" onclick="showHide('#tandt','#travel'), showHide('#endmile','#travel'),showHide('#begmile','#travel'),showHide('#citys','#travel'),showHide('#citye','#travel'),showHide('#states','#travel'),showHide('#statee','#travel'),disable('#fab','#travel'),disable('#prep','#travel'), disable('#shoot','#travel'), disable('#pickup','#travel'), disable('#return','#travel'), disable('#transport','#travel'), disable('#wrap','#travel'), disable('#rnm','#travel'), disable('#genlshop','#travel'), disable('#otherp','#travel')">&nbsp;	
			R&M:<input type="checkbox" value="R&M" id="rnm" name="JobType" disable="true" onclick="showHide('#cctype','#rnm'), showHide('#totcost','#rnm'), disable('#fab','#rnm'),disable('#prep','#rnm'), disable('#shoot','#rnm'), disable('#pickup','#rnm'), disable('#return','#rnm'), disable('#transport','#rnm'), disable('#wrap','#rnm'), disable('#travel','#rnm'), disable('#genlshop','#rnm'), disable('#fuel','#rnm'), disable('#otherp','#rnm'), disable('#jobnum','#rnm'), disable('#jobname','#rnm')"><br />&nbsp;
			Gen'l Shop:<input type="checkbox" value="Genl Shop" id="genlshop" name="JobType" disable="true" onclick="showHide('#cctype','#genlshop'), showHide('#totcost','#genlshop'), showHide('#jobdescription','#genlshop'), disable('#fab','#genlshop'),disable('#prep','#genlshop'), disable('#shoot','#genlshop'), disable('#pickup','#genlshop'), disable('#return','#genlshop'), disable('#transport','#genlshop'), disable('#wrap','#genlshop'), disable('#travel','#genlshop'), disable('#rnm','#genlshop'), disable('#fuel','#genlshop'), disable('#otherp','#genlshop'), disable('#jobnum','#genlshop'), disable('#jobname','#genlshop')">&nbsp;	
			Fuel Purchased:<input type="checkbox" value="Fuel Purchased" id="fuel" name="FuelPurch" disable="true" onclick="showHide('#cctype','#fuel'), showHide('#city','#fuel'), showHide('#state','#fuel'), showHide('#odometer','#fuel'), showHide('#totgallon','#fuel'), showHide('#totcost','#fuel')">&nbsp;
			<br /><br />
			Job:			
			<select name="JobDescript" id='jobnum' onchange="show(this.value)">
				<option value="" style="display:none;"></option>
				<?php
					//get the employee id from the session cookie
					$employeeId = $_SESSION["employee_id"];
					
					//make connection to database, bail if no connection
					$connection = odbc_pconnect('utrocks','','');
					if (!$connection) { exit("Connection Failed: " . $connection); }
					
					//retrieve usernames and passwords
					$sql = "SELECT ('Job Number: '&JobNumber + ' Job Name: '&JobName) as JobDescript FROM Jobs";
					
					$rs = odbc_exec($connection, $sql);
				
					while(odbc_fetch_row($rs)) {
						$rowJobNum = odbc_result($rs, 'JobDescript');
						printf("<option value='%s'>%s</option>", $rowJobNum, $rowJobNum);
					}
				
				?>
			</select><br /><br />
			
			
			<textarea name="JobDescription" cols="75" rows="8" id="otherpurch"></textarea><br>	

			</center>
	</td></tr>

<style media="screen" type="text/css">
.TTI{width:150px;float:left;margin-left:50px;}
.EM{width:150px;float:left;margin-left:50px;}
.BM{width:150px;float:left;margin-left:50px;}
.TM{width:150px;float:left;margin-left:50px;}
.CSS{width:150px;float:left;margin-left:50px;}
.CSE{width:150px;float:left;margin-left:50px;}
.TI{width:100px;float:right;}
.TIBox{width:300px;float:right;}
.LO{width:100px;float:right;}
.LOBox{width:300px;float:right}
.LI{width:100px;float:right;}
.LIBox{width:300px;float:right;}
.TO{width:100px;float:right;}
.TOBox{width:300px;float:right;}
.TW{width:100px;float:right;}
.TWBox{width:300px;float:right;}


.container{width:100%;overflow:auto;}


.input{
 float:left;  
 width:15%; 
}

.text{
	float:left;
	width:10%;
    padding-left:70px;
}
.clear {
    clear:both;
}

.boxes{width:50%;padding-left:350;}
​






</style>

	
	<tr><td>
		<div>
			<div class="TIBox"><select name="InTimeH" id='ith' type='int'>
						<option value=""> </option>	
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>	
					</select> 
					:
					<select name="InTimeM" id='itm'>
						<option value=""> </option>	
						<option value="00">00</option>
						<option value="15">15</option>
						<option value="30">30</option>
						<option value="45">45</option>
					</select> 	
					<select name="InTimeAPM" id='ita'>
						<option value=""> </option>	
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select></div>
			<div class="TI">Time In:</div>
			<div class="TTI">Truck & Trailer ID:</div>
			<div class="TTBox"><input type="text" id="tandt" name="TandT" disabled="true"/></div>
			<div class="LOBox"><select name="OutLunchH" id='olh'>
						<option value=""> </option>	
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>	
					</select> 
					:
					<select name="OutLunchM" id='olm'>
						<option value=""> </option>	
						<option value="00">00</option>
						<option value="15">15</option>
						<option value="30">30</option>
						<option value="45">45</option>
					</select>
					<select name="OutLunchAPM" id='ola'>
						<option value=""> </option>	
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select> </br></div>
			<div class="LO">Lunch Out:</div>
			<div class="EM">Ending Mileage:</div>
			<div class="EMBox>"><input type="text" id="endmile" name="EndMile" disabled="true"/></div>
			<div class="LIBox"><select name="InLunchH" id='ilh'>
						<option value=""> </option>	
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>	
					</select> 
					:
					<select name="InLunchM" id='ilm'>
						<option value=""> </option>	
						<option value="00">00</option>
						<option value="15">15</option>
						<option value="30">30</option>
						<option value="45">45</option>
					</select>
					<select name="InLunchAPM" id='ila'>
						<option value=""> </option>	
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select> </br></div>	
			<div class="LI">Lunch In:</div>	
			<div class="BM">Beginning Mileage:</div>
			<div class="BMBox"><input type="text" id="begmile" name="BeginMile" disabled="true" /></div>
			<div class="TOBox"><select name="OutTimeH" id='oth'>
						<option value=""> </option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>	
					</select> 
					:
					<select name="OutTimeM" id='otm'>
						<option value=""> </option>						
						<option value="00">00</option>
						<option value="15">15</option>
						<option value="30">30</option>
						<option value="45">45</option>
					</select> 
					<select name="OutTimeAPM" id='ota'>
						<option value=""> </option>	
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select>
					<br/></div>
			<div class="TO">Time Out:</div>
			<div class="TM">Total Mileage:</div>
			<div class="TMBox"><input type="text" id="totmile" name="TotMile" disabled="true" size='8'/><button type="button" onclick="subtract('#begmile', '#endmile', '#totmile')">Calculate</button></div>
			<div class="TWBox"><input type="text" id="tottime" name="TotTime" disabled="true" size='5'/><button type="button" onclick="totalT('#ith','#itm','#ita','#olh','#olm','#ola','#ilh','#ilm','#ila','#oth','#otm','#ota','#tottime')">Calculate</button></div>
			<div class="TW">Total Time:</div>
			<div class="CSS">City/State Start:</div>
			<div class="CSBox"><input type="text" name="CityS" id="citys" disabled="true" size='11'/><select name="StateS" id="states" disabled="true">
							<option value=""> </option>	
							<option value="AL">AL</option>
							<option value="AK">AK</option>
							<option value="AZ">AZ</option>
							<option value="AR">AR</option>
							<option value="CA">CA</option>
							<option value="CO">CO</option>
							<option value="CT">CT</option>
							<option value="DE">DE</option>
							<option value="DC">DC</option>
							<option value="FL">FL</option>
							<option value="GA">GA</option>
							<option value="HI">HI</option>
							<option value="ID">ID</option>
							<option value="IL">IL</option>
							<option value="IN">IN</option>
							<option value="IA">IA</option>
							<option value="KS">KS</option>
							<option value="KY">KY</option>
							<option value="LA">LA</option>
							<option value="ME">ME</option>
							<option value="MD">MD</option>
							<option value="MA">MA</option>
							<option value="MI">MI</option>
							<option value="MN">MN</option>
							<option value="MS">MS</option>
							<option value="MO">MO</option>
							<option value="MT">MT</option>
							<option value="NE">NE</option>
							<option value="NV">NV</option>
							<option value="NH">NH</option>
							<option value="NJ">NJ</option>
							<option value="NM">NM</option>
							<option value="NY">NY</option>
							<option value="NC">NC</option>
							<option value="ND">ND</option>
							<option value="OH">OH</option>
							<option value="OK">OK</option>
							<option value="OR">OR</option>
							<option value="PA">PA</option>
							<option value="RI">RI</option>
							<option value="SC">SC</option>
							<option value="SD">SD</option>
							<option value="TN">TN</option>
							<option value="TX">TX</option>
							<option value="UT">UT</option>
							<option value="VT">VT</option>
							<option value="VA">VA</option>
							<option value="WA">WA</option>
							<option value="WV">WV</option>
							<option value="WI">WI</option>
							<option value="WY">WY</option>
			</select>&nbsp;&nbsp;</div>
			<div class="CSE">City/State End:</div>
			<div class="CEBox"><input type="text" name="CityE" id="citye" disabled="true" size="11"/><select name="StateE" id="statee" disabled="true">
							<option value=""> </option>	
							<option value="AL">AL</option>
							<option value="AK">AK</option>
							<option value="AZ">AZ</option>
							<option value="AR">AR</option>
							<option value="CA">CA</option>
							<option value="CO">CO</option>
							<option value="CT">CT</option>
							<option value="DE">DE</option>
							<option value="DC">DC</option>
							<option value="FL">FL</option>
							<option value="GA">GA</option>
							<option value="HI">HI</option>
							<option value="ID">ID</option>
							<option value="IL">IL</option>
							<option value="IN">IN</option>
							<option value="IA">IA</option>
							<option value="KS">KS</option>
							<option value="KY">KY</option>
							<option value="LA">LA</option>
							<option value="ME">ME</option>
							<option value="MD">MD</option>
							<option value="MA">MA</option>
							<option value="MI">MI</option>
							<option value="MN">MN</option>
							<option value="MS">MS</option>
							<option value="MO">MO</option>
							<option value="MT">MT</option>
							<option value="NE">NE</option>
							<option value="NV">NV</option>
							<option value="NH">NH</option>
							<option value="NJ">NJ</option>
							<option value="NM">NM</option>
							<option value="NY">NY</option>
							<option value="NC">NC</option>
							<option value="ND">ND</option>
							<option value="OH">OH</option>
							<option value="OK">OK</option>
							<option value="OR">OR</option>
							<option value="PA">PA</option>
							<option value="RI">RI</option>
							<option value="SC">SC</option>
							<option value="SD">SD</option>
							<option value="TN">TN</option>
							<option value="TX">TX</option>
							<option value="UT">UT</option>
							<option value="VT">VT</option>
							<option value="VA">VA</option>
							<option value="WA">WA</option>
							<option value="WV">WV</option>
							<option value="WI">WI</option>
							<option value="WY">WY</option>
			</select></div>
			
			
			<?php for ($x=0; $x<=175; $x++){echo "&nbsp;";} ?>				
			<input type="hidden" name="Real" id="real" value="0"/>
			Daily Rate?: <input type="checkbox"  id='hrly' name="DailyCheck" onclick="isSet('#real,#hrly'), disable('#olh','#hrly'), disable('#olm','#hrly'), disable('#ola','#hrly'), disable('#ilh','#hrly'), disable('#ilm','#hrly'), disable('#ila','#hrly'),disable('#oth','#hrly'), disable('#otm','#hrly'), disable('#ota','#hrly'),disable('#ith','#hrly'), disable('#itm','#hrly'), disable('#ita','#hrly') "><br />
	</td></tr>
	<tr><td>
			<body><center><b><Font size="5">Fuel Purchases:</Font></b><br /><br /></center>

			<div class="container">
				<div class="text" name="CC">Credit Card:</div>
				<div class="input" name="CCBox"><select name="CCType" id='cctype' disabled='true'>
					<option value="" style="display:none;"></option>	
						<?php
						
							//get the employee id from the session cookie
							$employeeId = $_SESSION["employee_id"];
							
							//make connection to database, bail if no connection
							$connection = odbc_pconnect('utrocks','','');
							if (!$connection) { exit("Connection Failed: " . $connection); }
							
							//retrieve usernames and passwords
							$sql = "SELECT (CCType&' '&CCNumber) as CCDescript FROM CreditCards where EmployeeID='$employeeId'";
							
							$rs = odbc_exec($connection, $sql);
						
							while(odbc_fetch_row($rs)) {
								$rowJobNum = odbc_result($rs, 'CCDescript');
								printf("<option value='%s'>%s</option>", $rowJobNum, $rowJobNum);
							}
						
						?></select></div>
				<div class="text" name="Ci">City:</div>
				<div class="input" name="CiBox"><input type="text" id="city" name="City" disabled="true"/></div>
				<div class="text" name="St">State:</div>
				<div class="input" name="StBox"><select name="State" id="state" disabled="true">
							<option value=""> </option>	
							<option value="AL">AL</option>
							<option value="AK">AK</option>
							<option value="AZ">AZ</option>
							<option value="AR">AR</option>
							<option value="CA">CA</option>
							<option value="CO">CO</option>
							<option value="CT">CT</option>
							<option value="DE">DE</option>
							<option value="DC">DC</option>
							<option value="FL">FL</option>
							<option value="GA">GA</option>
							<option value="HI">HI</option>
							<option value="ID">ID</option>
							<option value="IL">IL</option>
							<option value="IN">IN</option>
							<option value="IA">IA</option>
							<option value="KS">KS</option>
							<option value="KY">KY</option>
							<option value="LA">LA</option>
							<option value="ME">ME</option>
							<option value="MD">MD</option>
							<option value="MA">MA</option>
							<option value="MI">MI</option>
							<option value="MN">MN</option>
							<option value="MS">MS</option>
							<option value="MO">MO</option>
							<option value="MT">MT</option>
							<option value="NE">NE</option>
							<option value="NV">NV</option>
							<option value="NH">NH</option>
							<option value="NJ">NJ</option>
							<option value="NM">NM</option>
							<option value="NY">NY</option>
							<option value="NC">NC</option>
							<option value="ND">ND</option>
							<option value="OH">OH</option>
							<option value="OK">OK</option>
							<option value="OR">OR</option>
							<option value="PA">PA</option>
							<option value="RI">RI</option>
							<option value="SC">SC</option>
							<option value="SD">SD</option>
							<option value="TN">TN</option>
							<option value="TX">TX</option>
							<option value="UT">UT</option>
							<option value="VT">VT</option>
							<option value="VA">VA</option>
							<option value="WA">WA</option>
							<option value="WV">WV</option>
							<option value="WI">WI</option>
							<option value="WY">WY</option>
					</select></div>
				<div class="text clear" name="Odom">Odometer:</div>
				<div class="input" name="OdomBox"><input type="text" id="odometer" name="Odometer" disabled="true"/></div>
				<div class="text" name="TotG">Total Gallons:</div>
				<div class="input" name="TotGBox"><input type="text" id="totgallon" name="TotGallon" disabled="true"/></div>
				<div class="text" name="TotC">Total Cost:</div>
				<div class="input" name="TotCBox"><input type="text" id="totcost" name="TotCost" disabled="true"/></div>
			</div>

			

			</body>
	</td></tr>
	
	<tr><td>
			<body><center><b><Font size="5">Vehicle Details:</Font></center></b>
				
				<div class="boxes">
				<?php
					
					//get the employee id from the session cookie
					$employeeId = $_SESSION["employee_id"];
					
					//make connection to database, bail if no connection
					$connection = odbc_pconnect('utrocks','','');
					if (!$connection) { exit("Connection Failed: " . $connection); }
					
					//retrieve usernames and passwords
					$sql = "SELECT Jobs.JobNumber, (Cars.VIN&' '&Cars.Make&' '&Cars.Model&' '&Cars.CarYear&' '&Cars.ExColor&' '&Cars.InColor&' ')as CarDescript
							FROM Cars, Jobs
							WHERE (Jobs.JobNumber=Cars.JobNumber);";

					$rs = odbc_exec($connection, $sql);
				
					while(odbc_fetch_row($rs)) {
						$carDescript = odbc_result($rs, 'CarDescript');
						$rowJobNum=odbc_result($rs,'JobNumber');
						printf("<div class='%s' hidden='true'>
						<input type='checkbox' name='CarDescription[]' value='%s'>%s</input></br></div>",$rowJobNum, $carDescript, $carDescript);
					}
				
				?>
				</div>
				<div id="vehicleDescription"></div>
			</body>
	</td></tr>
	<tr><td>
	<center>
		<br />
		<button type="submit">Submit</button>
		<br /><br />
	</center>
	</td></tr>
	</form>
</table>
</center>
<?php
	}	

}
?>

<script type="text/javascript"> 

var previous=' ';
var x=0;
var y=0;
var z=0;

var a=0;
var b=0;
var c=0;
var d=0;
var e=0;
var f=0;
var g=0;
var h=0;
function showHide(id,check) {
	if( $(check).is(':checked')){
		$(id).attr('disabled',false);
	}else{
		$(id).attr('disabled',true);
	}
}

function expose(id){
	$(id).attr('disabled',false);
}

function disable(id,check){
	if( !$(check).is(':checked')){
		$(id).attr('disabled',false);
	}else{
		$(id).attr('disabled',true);
	}
}

function isSet(id,check){
		$(id).attr('value','1');
}

function show(JobDescript){
	JobDescript=JobDescript.replace("Job Number: ","");
	JobDescript=JobDescript.replace("Job Name: ","");
	JobDescript = JobDescript.substring(0, JobDescript.indexOf(' '));
	$('.'+JobDescript).removeAttr('hidden');
	if(x==0){
		previous=JobDescript;
	}
		
	if(x==1){
		$('.'+previous).attr('hidden',true);
		previous=JobDescript;
	}
	x=1;
}

function subtract(begmile, endmile, totmile){
	y=$(begmile).attr('value');
	z=$(endmile).attr('value');
	y=z-y;
	$(totmile).attr('value',y);	
}

function totalT(ith,itm,ita,olh,olm,ola,ilh,ilm,ila,oth,otm,ota,totaltime){
	a=Number($(ith).attr('value'));
	b=Number($(olh).attr('value'));		
	c=Number($(ilh).attr('value'));
	d=Number($(oth).attr('value'));
	if($(ita).attr('value')=='PM'){
		if($(ith).attr('value')!='12'){
			a=Number($(ith).attr('value'))+12;
		}
	}
	if($(ola).attr('value')=='PM'){
		if($(olh).attr('value')!='12'){
			b=Number($(olh).attr('value'))+12;
		}
	}	
	if($(ila).attr('value')=='PM'){
		if($(ilh).attr('value')!='12'){
			c=Number($(ilh).attr('value'))+12;
		}
	}	
	if($(ota).attr('value')=='PM'){
		d=Number($(oth).attr('value'))+12;
	}
	e=Number($(itm).attr('value'));
	f=Number($(olm).attr('value'));
	g=Number($(ilm).attr('value'));
	h=Number($(otm).attr('value'));
	
	e=(f-e)+(h-g);
	e=e/60;
	a=d-a-(c-b)+e;	
	$(totaltime).attr('value',a);	
}

	
</script>
</html>

 
